<?php

namespace App\Http\Controllers\Admin;
use App\User;
use Illuminate\Support\Facades\Hash;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\DB;
use App\Models\Login;

class LoginController extends Controller
{

    /*
     * 显示登录页面
     * */
    public function login(){
        return view('admin.login.login');
    }
    /*
     * 检验登录
     * */
    public function checkLogin(Request $request){
          return  Login::check($request);
      }

    /*
   * 定义一个方法logout，用于用户退出账号
   * @param $request 对象
   * @return response 成功返回true，失败返回false
   * */
    public function logout(Request $request){
        $request->session()->flush();
        return redirect('login');
    }
}
